fix: repair cross-package bugs causing test and type failures#46
Open
stooit wants to merge 1 commit into
Open
Conversation
- utils: re-export renamed useDebounce hook as useSearchDebounce alias; update apps/web api.ts to consume it (removes stale useThrottle import) - utils: fix formatDate to day-first locale-correct output (en-AU short) - ui: forward aria-label on Button, with sensible default for icon-only - tsconfig: resolve bun:test types via ambient bun-env.d.ts reference (avoids narrowing global @types discovery)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and type errors across the monorepo. The failures spanned three packages and a shared tsconfig. All 13 tests pass and
bunx tsc --noEmitis clean.Changes
packages/utils— A hook was renameduseThrottle→useDebouncebut consumers still imported the old name. Added a re-export aliasuseDebounce as useSearchDebouncefrom the package barrel so@e2e/utilsexposes the name the test expects, without duplicating the implementation.apps/web/src/lib/api.ts— Updated to import/re-exportuseSearchDebounce(was importing the removeduseThrottle), fixing both the runtime test and the tsc error.packages/utils/src/format/date.ts—formatDateproduced zero-padded / wrong-order output. Switched to a locale-correct day-first short format so dates like 1 March render1/03/...rather than month-first or zero-padded.packages/ui/Button— Icon-only buttons weren't forwardingaria-labelto the DOM. Now forwards an explicitly suppliedaria-label, and applies a sensible default for icon-only buttons when none is given (accessibility requirement from the test).tsconfig.json+bun-env.d.ts— Test files usebun:test, which tsc couldn't resolve. Fixed via an ambient/// <reference types="bun-types" />file rather than atypesarray, to avoid disabling automatic@types/*discovery (which could break a real Next.js build).Verification
bun run test→ 13 pass / 0 failbunx tsc --noEmit→ 0 errorsAssumptions